﻿<UserControl x:Class="WpfDialogApplication.Views.MainView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:viewModels="clr-namespace:WpfDialogApplication.ViewModels"
             xmlns:apexControls="clr-namespace:Apex.Controls;assembly=Apex"
             mc:Ignorable="d" 
             d:DesignHeight="380" d:DesignWidth="460">
    
    <!-- Set the view model. -->
    <UserControl.DataContext>
        <viewModels:MainViewModel x:Name="viewModel" />
    </UserControl.DataContext>

    <apexControls:ApexGrid Rows="Auto,*,Auto">

        <!-- Top block of color. -->
        <apexControls:MultiBorder Grid.Row="0" Height="60" Background="#FFFFFF">

            <!-- The title block. -->
            <TextBlock Grid.Row="0" FontWeight="Light" Text="{Binding Title}" VerticalAlignment="Center" Margin="20,0,0,0" FontSize="24" />

        </apexControls:MultiBorder>

        <!-- Main content. -->
        <apexControls:MultiBorder Grid.Row="1"
                                  BorderThicknessTop="1" BorderBrushTop="#dadada"
                                  BorderThicknessBottom="1" BorderBrushBottom="#b8c2d5">
            <apexControls:MultiBorder.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <GradientStop Offset="0" Color="#f1f1f1" />
                    <GradientStop Offset="0.2" Color="#ffffff" />
                    <GradientStop Offset="0.4" Color="#fbfcfe" />
                    <GradientStop Offset="1" Color="#ccd7ec" />
                </LinearGradientBrush>
            </apexControls:MultiBorder.Background>

            <apexControls:ApexGrid Grid.Row="2" Rows="Auto,Auto" Margin="20">

                <TextBlock Grid.Row="0" TextWrapping="Wrap">Main content can go here.</TextBlock>
                <TextBlock Grid.Row="1" TextWrapping="Wrap">This application was last run at: <Run Text="{Binding LastRunTime}" />.</TextBlock>

            </apexControls:ApexGrid>

        </apexControls:MultiBorder>

        <apexControls:MultiBorder Grid.Row="2" Height="50" Background="#ccd7ec"
                                  BorderThicknessTop="1" BorderBrushTop="#dce3f2" Padding="20,0,20,0">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                <Button Command="{Binding CloseCommand}" Width="100" Height="24" Content="Close" />
            </StackPanel>

        </apexControls:MultiBorder>

    </apexControls:ApexGrid>
</UserControl>
